 public class FileUploader
    { 
       
        public class Host : WebAction
        {
            ILogger log = Logger.GetLogger("文件上传");
            public UploadResponse Upload(string fileName, byte[] fileData,string siteName)
            {
                try
                {
                    string ResourcesUrl = WebConfiguration.Default.ResourcesUrl + "HttpHandle/upload"; 
                    BoundaryPostInfo postInfo = new BoundaryPostInfo();
                    postInfo.AddFile(fileName, fileData);
                    postInfo.AddPars("SiteName", siteName);
                    postInfo.AddPars("OrgFileName", fileName);
                    log.Debug(fileName + "---" + siteName + "---" + fileData.Length);
                    var json = GetWebData<string>(ResourcesUrl, postInfo: postInfo,timeOut:60*60*1000);
                    log.Debug(json);
                    return JsonConvert.DeserializeObject<UploadResponse>(json);

                }
                catch (Exception ex)
                {
                    log.Error(ex, "");

                    return new UploadResponse() { code =  ReponseCode.ClientError, url = "" };
                }
            }

        }

        static Host host = new Host();

        public static UploadResponse Upload(string fileName, byte[] fileData)
        { 
            return Upload(fileName, fileData,"MX");
        }
        public static UploadResponse Upload(string fileName, byte[] fileData,string siteName)
        {

            return host.Upload(fileName, fileData, siteName);
        }

    }